<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户登录处理页面</title>
</head>
<body>
<%
	//取出属性值
	String userName = (String)request.getParameter("userName");//获取用户名
	String password = (String)request.getParameter("pwd");//获取用户密码
	String remember = (String)request.getParameter("remember");//获取记住密码信息
	out.println("用户名："+userName+"</br>");
	out.println("用户密码："+password+"</br>");
	out.println("是否记住密码："+remember+"</br>");
	if("true".equals(remember)){
		Cookie userNameAndPwd = new Cookie("userNameAndPwd",userName+"+"+password);//创建Cookie项
		userNameAndPwd.setMaxAge(7*24*3600);//设置Cookie生命周期1星期
		response.addCookie(userNameAndPwd);//回应客户端浏览器保存Cookie在客户端本地
		out.println("设置cookie成功"+"</br>");
	}
	response.sendRedirect("response03.jsp");//返回原页面
	
%>
</body>
</html>